Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set-value-* #400

Merged
merged 9 commits into from
Sep 20, 2024
Merged

Add set-value-* #400

merged 9 commits into from
Sep 20, 2024

Conversation

hahwul
Copy link
Member

@hahwul hahwul commented Sep 18, 2024

Hiya @ksg97031

I've added the --set-pvalue-* flags as discussed(#395 and #394) previously. Here's how they work:

  • --set-pvalue applies to all parameters.
  • You can also set values individually for each param_type. (e.g --set-pvalue-cookie --set-pvalue-path)

These flags allow you to specify multiple rules through nesting. If a single value is provided, it replaces the existing value. If the value is specified with = or :, which distinguishes it from the parameter name, only that specific parameter's value is replaced.

I've run various tests on it; do you think there might be room for further improvements?

🇰🇷 지난번에 논의했었던 --set-pvalue 관련 flag들이 추가되었습니다. 모두 공통적인 로직을 가지고 있고, 단일 값으로 들어오는 경우 해당 값으로 치환되고 =:를 통해 파라미터 이름과 구별해서 들어오는 경우(e.g --set-pvalue-cookie "auth=1234" 해당 파라미터 명만 치환됩니다. 이것저것 테스트하긴 했는데, 혹시 모자란 부분이나 더 개선할 부분이 더 있을까요? (옵션 자체가 살짝 복잡해서 문서화를 꼼꼼히 해야할 것 같아요)

    --set-pvalue VALUE               Specifies the value of the identified parameter for all types
    --set-pvalue-header VALUE        Specifies the value of the identified parameter for headers
    --set-pvalue-cookie VALUE        Specifies the value of the identified parameter for cookies
    --set-pvalue-query VALUE         Specifies the value of the identified parameter for query parameters
    --set-pvalue-form VALUE          Specifies the value of the identified parameter for form data
    --set-pvalue-json VALUE          Specifies the value of the identified parameter for JSON data
    --set-pvalue-path VALUE          Specifies the value of the identified parameter for path parameters

Tests

set-pvalue

select param - case1 :

select param - case2 =

set-pvalue-cookie

set-pvalue-header

select header

set-pvalue-path


@github-actions github-actions bot added 📑 documentation Improvements or additions to documentation ⚙️ options Issue for options (flag) ⛱️ config Issue for Configuration labels Sep 18, 2024
@hahwul hahwul added this to the v0.18.0 milestone Sep 18, 2024
@hahwul hahwul self-assigned this Sep 18, 2024
@hahwul hahwul marked this pull request as ready for review September 18, 2024 15:21
@hahwul
Copy link
Member Author

hahwul commented Sep 19, 2024

Asterisk symbol --set-pvalue=*:1234=444
-> 1234=444

@hahwul
Copy link
Member Author

hahwul commented Sep 19, 2024

Test

Asterisk

--set-pvalue "*:444:44" -> body: test_param=444:44
--set-pvalue "*:444=44" -> body: test_param=444=44
--set-pvalue "*=444:44" -> body: test_param=444:44
--set-pvalue "*=444=44" -> body: test_param=444=44

Select param

--set-pvalue "test_param:444:44" -> body: test_param=444:44
--set-pvalue "test_param:444=44" -> body: test_param=444=44
--set-pvalue "test_param=444:44" -> body: test_param=444:44
--set-pvalue "test_param=444=44" -> body: test_param=444=44

@github-actions github-actions bot added 🔎 detector Issue for Detector 🔬 analyzer Issue for Analyzer 📦 output-builder Issue for output builder (format) 💊 spec Issue for test codes 💌 deliver Issue for Deliver labels Sep 20, 2024
@hahwul hahwul merged commit e65b0fc into dev Sep 20, 2024
9 checks passed
@hahwul hahwul deleted the add-set-pvalue-x branch September 20, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔬 analyzer Issue for Analyzer ⛱️ config Issue for Configuration 💌 deliver Issue for Deliver 🔎 detector Issue for Detector 📑 documentation Improvements or additions to documentation ⚙️ options Issue for options (flag) 📦 output-builder Issue for output builder (format) 💊 spec Issue for test codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvement: Extend --set-pvalue Functionality for Cookies, Headers, Queries and ETC
1 participant